from django.shortcuts import render
from django.core.paginator import Paginator
# Create your views here.
def book_list(request):
    books=['python','django','inspect','java'
           ,'css','redis','html','english',
           'math','china',
           ]
    # 分页,每页三条数据
    paginator=Paginator(books,3)
    # 获取第一页数据
    page_num=request.GET.get('page_num',1)
    page=paginator.page(page_num)
    return render(request,'book_list.html',locals())